]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Use logErrorUnlessCancelled() helper
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 22 Oct 2025 01:30:41 +0000 (03:30 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 24 Oct 2025 15:37:15 +0000 (15:37 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3927>

js/gdm/util.js
js/misc/ibusManager.js
js/misc/inputMethod.js

index 2d54ea25ca1d9357a0be545b3a61c1c6497cbb9c..5d33837d928617e9703190110e2c1bdf8a75f087 100644 (file)
@@ -8,6 +8,7 @@ import * as Batch from './batch.js';
 import * as OVirt from './oVirt.js';
 import * as Vmware from './vmware.js';
 import * as Main from '../ui/main.js';
+import {logErrorUnlessCancelled} from '../misc/errorUtils.js';
 import {loadInterfaceXML} from '../misc/fileUtils.js';
 import * as Params from '../misc/params.js';
 import * as SmartcardManager from '../misc/smartcardManager.js';
@@ -240,8 +241,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
             await this._handlePendingMessages();
             this._userVerifier.call_answer_query(serviceName, answer, this._cancellable, null);
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
-                logError(e);
+            logErrorUnlessCancelled(e);
         }
     }
 
@@ -858,8 +858,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
                 this._retry(serviceName);
             }
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
-                logError(e);
+            logErrorUnlessCancelled(e);
         }
     }
 
index 59842dc5709546c0ac4965e1e93d4f11c44fc1ad..3635fd30ef95182097c196fc876e8f16a0bc4541 100644 (file)
@@ -6,6 +6,7 @@ import Shell from 'gi://Shell';
 
 import * as Signals from './signals.js';
 import * as BoxPointer from '../ui/boxpointer.js';
+import {logErrorUnlessCancelled} from './errorUtils.js';
 
 import * as IBusCandidatePopup from '../ui/ibusCandidatePopup.js';
 
@@ -172,11 +173,8 @@ class IBusManager extends Signals.EventEmitter {
             }
             this._updateReadiness();
         } catch (e) {
-            if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
-                return;
-
-            logError(e);
-            this._clear();
+            if (logErrorUnlessCancelled(e))
+                this._clear();
         }
     }
 
@@ -185,10 +183,8 @@ class IBusManager extends Signals.EventEmitter {
             await this._ibus.request_name_async(IBus.SERVICE_PANEL,
                 IBus.BusNameFlag.REPLACE_EXISTING, -1, this._cancellable);
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
-                logError(e);
+            if (logErrorUnlessCancelled(e))
                 this._clear();
-            }
             return;
         }
 
@@ -287,8 +283,7 @@ class IBusManager extends Signals.EventEmitter {
                 this._MAX_INPUT_SOURCE_ACTIVATION_TIME,
                 this._cancellable);
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
-                logError(e);
+            logErrorUnlessCancelled(e);
         }
     }
 
index cc32f50bb8a015a636f629235df4071d56f57044..f15eb2e398458c2859e24b6d8ceb74c2724b6530 100644 (file)
@@ -4,6 +4,7 @@ import Gio from 'gi://Gio';
 import GObject from 'gi://GObject';
 import IBus from 'gi://IBus';
 
+import {logErrorUnlessCancelled} from './errorUtils.js';
 import * as Keyboard from '../ui/status/keyboard.js';
 import * as Main from '../ui/main.js';
 
@@ -75,10 +76,8 @@ export const InputMethod = GObject.registerClass({
             this._context = await this._ibus.create_input_context_async(
                 'gnome-shell', -1, this._cancellable);
         } catch (e) {
-            if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
-                logError(e);
+            if (logErrorUnlessCancelled(e))
                 this._clear();
-            }
             return;
         }